<template>
  <div class="page-container" >
    <el-header>
      <div style="box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);border-radius: 4px">


        <div style="height:150px;box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);border-radius: 4px;">
          <el-row >
            <el-col :span="24"><div class="grid-content bg-purple-light" style="text-align: left;">当前操作进度</div></el-col>
            <el-col :span="24"><div class="grid-content" >
              <el-steps align-center :space="200" :active="active" finish-status="success">
                <el-step title="1.选择合同"></el-step>
                <el-step title="2.选择商品"></el-step>
                <el-step title="3.参数设置"></el-step>
              </el-steps>
              <el-button style="margin-top: 12px;" @click="preStep">上一步</el-button>
              <el-button style="margin-top: 12px;" @click="nextStep">下一步</el-button>
            </div></el-col>
          </el-row>
        </div>

      </div>
    </el-header>
    <el-main>
      <div style="box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);border-radius: 4px;">
        <!--工具栏-->
        <div class="toolbar" style="float:left;padding-top:10px;padding-left:15px;">
          <el-form :inline="true" :model="filters" :size="size" ref="filters">
            <el-form-item prop="merchantName">
              <el-input v-model="filters.merchantName" readonly placeholder="选择商家" @focus="queryMerchantList"></el-input>
            </el-form-item>
            <el-form-item prop="merchantId">
              <el-input style="display:none" v-model="filters.merchantId"  hidden placeholder="商家id"></el-input>
            </el-form-item>
            <el-form-item prop="supplierCode">
              <el-input v-model="filters.supplierCode" placeholder="供应商编码"></el-input>
            </el-form-item>
            <el-form-item prop="supplierName">
              <el-input v-model="filters.supplierName" placeholder="供应商名称"></el-input>
            </el-form-item>
            <el-form-item prop="contractCode">
              <el-input v-model="filters.contractCode" placeholder="合同编码"></el-input>
            </el-form-item>
            <el-row>
              <el-form-item>
                <kt-button
                  icon="fa fa-search"
                  :label="$t('action.search')"
                  type="primary"
                  @click="findPage(null)"
                />
              </el-form-item>
              <el-form-item>
                <kt-button icon="fa fa-refresh" :label="$t('action.reset')" type="primary" @click="resetForm('filters')"/>
              </el-form-item>
            </el-row>
          </el-form>
        </div>
        <div class="toolbar" style="float:right;padding-top:10px;padding-right:15px;">
          <el-form :inline="true" :size="size">
            <el-form-item>
              <el-button-group>
                <el-tooltip content="刷新" placement="top">
                  <el-button icon="fa fa-refresh" @click="findPage(null)"></el-button>
                </el-tooltip>
                <el-tooltip content="列显示" placement="top">
                  <el-button icon="fa fa-filter" @click="displayFilterColumnsDialog"></el-button>
                </el-tooltip>
              </el-button-group>
            </el-form-item>
          </el-form>
          <!--表格显示列界面-->
          <table-column-filter-dialog
            ref="tableColumnFilterDialog"
            :columns="columns"
            @handleFilterColumns="handleFilterColumns"
          ></table-column-filter-dialog>
        </div>
        <!--表格内容栏-->
        <cy-table
          :height="350"
          :data="pageResult"
          :columns="filterColumns"
          :showOperation="false"
          :showEditOperation="false"
          :showDeleteOperation="false"
          :showBatchDelete="false"
          @findPage="findPage"
          @selectionChange="selectionChange"
          ref="CyTable"
        ></cy-table>
      </div>
    </el-main>


    <!--选择商家页面-->
    <el-dialog
      title="选择商品"
      width="65%"
      :visible.sync="editDialogVisible"
      :close-on-click-modal="false"
    >
      <el-form
        :model="dataFormProduct"
        label-width="180px"
        ref="dataFormProduct"
        :size="size"
      >
        <el-form-item prop="categoryId">
          <el-select v-model="dataFormProduct.categoryId" placeholder="商品类目" auto-complete="off">
            <el-option v-for="item in categoryList" :key="item.categoryId" :label="item.categoryName" :value="item.categoryId"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="商品名称" prop="mpName">
          <el-input v-model="dataFormProduct.mpName" auto-complete="off" ></el-input>
        </el-form-item>
        <el-form-item label="商品编码" prop="mpCode">
          <el-input v-model="dataFormProduct.mpCode" auto-complete="off" ></el-input>
        </el-form-item>

        <el-button
          :size="size"
          type="primary"
          @click.native=""
          :loading="editLoading"
        >{{$t('action.submit')}}
        </el-button>
        <el-button
          :size="size"
          type="primary"
          @click.native="resetForm('dataFormProduct')"
        >{{$t('action.reset')}}</el-button>
      </el-form>
      <el-table
        :data="tableData"
        style="width: 100%">
        <el-table-column
          prop="mpCode"
          label="商品编码"
          width="150">
        </el-table-column>
        <el-table-column
          prop="barcode"
          label="商品条码"
          width="150">
        </el-table-column>
        <el-table-column
          prop="mpName"
          label="商品名称"
          width="150">
        </el-table-column>
        <el-table-column
          prop="brandName"
          label="商品品牌"
          width="150">
        </el-table-column>
        <el-table-column
          prop="categoryName"
          label="商品类目"
          width="150">
        </el-table-column>
        <el-table-column
          prop="mpUnit"
          label="主要计量单位"
          width="150">
        </el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button
              size="mini"
              @click="clickProduct(scope.$index, scope.row)">选择此项</el-button>
          </template>
        </el-table-column>
      </el-table>

    </el-dialog>
  </div>

</template>

<script>
  import PopupTreeInput from "@/components/PopupTreeInput";
  import CyTable from "@/views/Core/CyTable";
  import KtTable from "@/views/Core/KtTable";
  import KtButton from "@/views/Core/KtButton";
  import TableColumnFilterDialog from "@/views/Core/TableColumnFilterDialog";
  import { format } from "@/utils/datetime";
  import utils from "@/assets/js/utils.js";

  export default {
    name: "ContractProductPriceStep2",

    components: {
      CyTable,
      KtButton,
      TableColumnFilterDialog
    },

    data() {
      return {
        size: "small",
        categoryList:[[{"categoryId":"1","categoryName":"箱包"}]],
        filters: {
          merchantName:"",
          merchantId:"",
          supplierCode:"",
          supplierName:"",
          contractCode:"",
          res:{
            "total": 1,
            "code": "0000",
            "rows": []
          }
        },
        columns: [
          {prop: "contractCode", label: "合同编码", minWidth: 80},
          {prop: "contractTypeText", label: "合同类型", minWidth: 60},
          {prop: "contractPropertyText", label: "合同属性", minWidth: 60},
          {prop: "isValidText", label: "是否有效", minWidth: 60},
          {prop: "supplierCode", label: "供应商编码", minWidth: 120},
          {prop: "supplierName", label: "供应商名称", minWidth: 70},
          {prop: "merchantName", label: "商家名称", minWidth: 60},
          {prop: "currencyCode", label: "交易币别", minWidth: 60},
          {prop: "effectiveTime", label: "合同生效日期", minWidth: 80},
          {prop: "expireTime", label: "合同失效日期", minWidth: 80}
        ],

        tableData: [
            {
              "currentPage": 0,
              "itemsPerPage": 0,
              "dataType": null,
              "chineseName": null,
              "code": null,
              "thirdProductCode": null,
              "brandIds": null,
              "categoryIds": null,
              "parentIds": null,
              "parentId": null,
              "type": null,
              "status": null,
              "productIds": null,
              "productId": null,
              "typeOfProducts": null,
              "typeOfProduct": null,
              "saleType": null,
              "mainUnitName": null,
              "channelCode": null,
              "orderType": null,
              "id": 1911060000466413,
              "mpId": 1911060000466413,
              "mpName": "测试商品002",
              "defaultSupplier": null,
              "firstCategoryId": null,
              "mpCode": "1911060000465847",
              "mpCodeList": null,
              "categoryId": 1909160000185958,
              "categoryName": "米面粥",
              "categoryNodeName": "米面粥",
              "merchantCategoryId": null,
              "merchantCategoryNodeName": null,
              "mpUnit": "件",
              "mpPrice": null,
              "costWithTaxUnitAmt": null,
              "costWithoutTaxUnitAmt": null,
              "mpTax": null,
              "mpPriceWithoutTax": null,
              "mpType": 1,
              "mpTypeText": "普通商品",
              "mpStandard": null,
              "turnoverChannel": null,
              "turnoverChannelText": "",
              "saleTaxRate": 0.11,
              "purchaseTaxRate": 0.10,
              "mpStock": null,
              "brandId": null,
              "brandName": null,
              "barcodeId": null,
              "barcode": null,
              "mpBarcode": null,
              "remark": null,
              "distributionCount": null,
              "currentDelvieryStockCount": null,
              "targetStoreId": null,
              "targetWarehouseId": null,
              "onShelfNum": 0,
              "ongoingNum": 0,
              "inventoryTurnoverDay": 7,
              "isSale": 1,
              "isSaleText": "允许销售",
              "realStockNum": 0,
              "availableStockNum": 0,
              "merchantId": 1909110000098882,
              "merchantIds": null,
              "barcodes": null,
              "mpIds": null,
              "itemIds": null,
              "storeId": null,
              "storeCode": null,
              "storeName": null,
              "storeIds": null,
              "warehouseIds": null,
              "warehouseId": null,
              "warehouseCode": null,
              "warehouseName": null,
              "promotionId": null,
              "promotionName": null,
              "majorPromotionType": null,
              "majorPromotionTypeText": null,
              "promotionType": null,
              "promotionTypeText": null,
              "promotionStartTime": null,
              "promotionEndTime": null,
              "virtualId": null,
              "canSale": null,
              "startItem": 0
            },
            {
              "currentPage": 0,
              "itemsPerPage": 0,
              "dataType": null,
              "chineseName": null,
              "code": null,
              "thirdProductCode": null,
              "brandIds": null,
              "categoryIds": null,
              "parentIds": null,
              "parentId": null,
              "type": null,
              "status": null,
              "productIds": null,
              "productId": null,
              "typeOfProducts": null,
              "typeOfProduct": null,
              "saleType": null,
              "mainUnitName": null,
              "channelCode": null,
              "orderType": null,
              "id": 1909170000080289,
              "mpId": 1909170000080289,
              "mpName": "普通商品001",
              "defaultSupplier": null,
              "firstCategoryId": null,
              "mpCode": "111111",
              "mpCodeList": null,
              "categoryId": 1909160000185958,
              "categoryName": "米面粥",
              "categoryNodeName": "米面粥",
              "merchantCategoryId": null,
              "merchantCategoryNodeName": null,
              "mpUnit": "千克",
              "mpPrice": null,
              "costWithTaxUnitAmt": null,
              "costWithoutTaxUnitAmt": null,
              "mpTax": null,
              "mpPriceWithoutTax": null,
              "mpType": 1,
              "mpTypeText": "普通商品",
              "mpStandard": null,
              "turnoverChannel": null,
              "turnoverChannelText": "",
              "saleTaxRate": 0.11,
              "purchaseTaxRate": 0.10,
              "mpStock": null,
              "brandId": null,
              "brandName": "贝因美",
              "barcodeId": null,
              "barcode": null,
              "mpBarcode": null,
              "remark": null,
              "distributionCount": null,
              "currentDelvieryStockCount": null,
              "targetStoreId": null,
              "targetWarehouseId": null,
              "onShelfNum": 0,
              "ongoingNum": 0,
              "inventoryTurnoverDay": 7,
              "isSale": 1,
              "isSaleText": "允许销售",
              "realStockNum": 0,
              "availableStockNum": 0,
              "merchantId": 1909110000098882,
              "merchantIds": null,
              "barcodes": null,
              "mpIds": null,
              "itemIds": null,
              "storeId": null,
              "storeCode": null,
              "storeName": null,
              "storeIds": null,
              "warehouseIds": null,
              "warehouseId": null,
              "warehouseCode": null,
              "warehouseName": null,
              "promotionId": null,
              "promotionName": null,
              "majorPromotionType": null,
              "majorPromotionTypeText": null,
              "promotionType": null,
              "promotionTypeText": null,
              "promotionStartTime": null,
              "promotionEndTime": null,
              "virtualId": null,
              "canSale": null,
              "startItem": 0
            },
            {
              "currentPage": 0,
              "itemsPerPage": 0,
              "dataType": null,
              "chineseName": null,
              "code": null,
              "thirdProductCode": null,
              "brandIds": null,
              "categoryIds": null,
              "parentIds": null,
              "parentId": null,
              "type": null,
              "status": null,
              "productIds": null,
              "productId": null,
              "typeOfProducts": null,
              "typeOfProduct": null,
              "saleType": null,
              "mainUnitName": null,
              "channelCode": null,
              "orderType": null,
              "id": 1912250009956430,
              "mpId": 1912250009956430,
              "mpName": "特价商品",
              "defaultSupplier": null,
              "firstCategoryId": null,
              "mpCode": "1912250009956422",
              "mpCodeList": null,
              "categoryId": 1909220000112658,
              "categoryName": "安抚玩偶",
              "categoryNodeName": "安抚玩偶",
              "merchantCategoryId": null,
              "merchantCategoryNodeName": null,
              "mpUnit": "件",
              "mpPrice": null,
              "costWithTaxUnitAmt": null,
              "costWithoutTaxUnitAmt": null,
              "mpTax": null,
              "mpPriceWithoutTax": null,
              "mpType": 1,
              "mpTypeText": "普通商品",
              "mpStandard": null,
              "turnoverChannel": null,
              "turnoverChannelText": "",
              "saleTaxRate": 0.11,
              "purchaseTaxRate": 0.10,
              "mpStock": null,
              "brandId": null,
              "brandName": null,
              "barcodeId": null,
              "barcode": null,
              "mpBarcode": null,
              "remark": null,
              "distributionCount": null,
              "currentDelvieryStockCount": null,
              "targetStoreId": null,
              "targetWarehouseId": null,
              "onShelfNum": 0,
              "ongoingNum": 0,
              "inventoryTurnoverDay": 7,
              "isSale": 1,
              "isSaleText": "允许销售",
              "realStockNum": 0,
              "availableStockNum": 0,
              "merchantId": 1909110000098882,
              "merchantIds": null,
              "barcodes": null,
              "mpIds": null,
              "itemIds": null,
              "storeId": null,
              "storeCode": null,
              "storeName": null,
              "storeIds": null,
              "warehouseIds": null,
              "warehouseId": null,
              "warehouseCode": null,
              "warehouseName": null,
              "promotionId": null,
              "promotionName": null,
              "majorPromotionType": null,
              "majorPromotionTypeText": null,
              "promotionType": null,
              "promotionTypeText": null,
              "promotionStartTime": null,
              "promotionEndTime": null,
              "virtualId": null,
              "canSale": null,
              "startItem": 0
            },
            {
              "currentPage": 0,
              "itemsPerPage": 0,
              "dataType": null,
              "chineseName": null,
              "code": null,
              "thirdProductCode": null,
              "brandIds": null,
              "categoryIds": null,
              "parentIds": null,
              "parentId": null,
              "type": null,
              "status": null,
              "productIds": null,
              "productId": null,
              "typeOfProducts": null,
              "typeOfProduct": null,
              "saleType": null,
              "mainUnitName": null,
              "channelCode": null,
              "orderType": null,
              "id": 1912250009947625,
              "mpId": 1912250009947625,
              "mpName": "折扣商品",
              "defaultSupplier": null,
              "firstCategoryId": null,
              "mpCode": "1912250009947624",
              "mpCodeList": null,
              "categoryId": 1909160000185958,
              "categoryName": "米面粥",
              "categoryNodeName": "米面粥",
              "merchantCategoryId": null,
              "merchantCategoryNodeName": null,
              "mpUnit": "件",
              "mpPrice": null,
              "costWithTaxUnitAmt": null,
              "costWithoutTaxUnitAmt": null,
              "mpTax": null,
              "mpPriceWithoutTax": null,
              "mpType": 1,
              "mpTypeText": "普通商品",
              "mpStandard": null,
              "turnoverChannel": null,
              "turnoverChannelText": "",
              "saleTaxRate": 0.11,
              "purchaseTaxRate": 0.10,
              "mpStock": null,
              "brandId": null,
              "brandName": null,
              "barcodeId": null,
              "barcode": null,
              "mpBarcode": null,
              "remark": null,
              "distributionCount": null,
              "currentDelvieryStockCount": null,
              "targetStoreId": null,
              "targetWarehouseId": null,
              "onShelfNum": 0,
              "ongoingNum": 0,
              "inventoryTurnoverDay": 7,
              "isSale": 1,
              "isSaleText": "允许销售",
              "realStockNum": 0,
              "availableStockNum": 0,
              "merchantId": 1909110000098882,
              "merchantIds": null,
              "barcodes": null,
              "mpIds": null,
              "itemIds": null,
              "storeId": null,
              "storeCode": null,
              "storeName": null,
              "storeIds": null,
              "warehouseIds": null,
              "warehouseId": null,
              "warehouseCode": null,
              "warehouseName": null,
              "promotionId": null,
              "promotionName": null,
              "majorPromotionType": null,
              "majorPromotionTypeText": null,
              "promotionType": null,
              "promotionTypeText": null,
              "promotionStartTime": null,
              "promotionEndTime": null,
              "virtualId": null,
              "canSale": null,
              "startItem": 0
            },
            {
              "currentPage": 0,
              "itemsPerPage": 0,
              "dataType": null,
              "chineseName": null,
              "code": null,
              "thirdProductCode": null,
              "brandIds": null,
              "categoryIds": null,
              "parentIds": null,
              "parentId": null,
              "type": null,
              "status": null,
              "productIds": null,
              "productId": null,
              "typeOfProducts": null,
              "typeOfProduct": null,
              "saleType": null,
              "mainUnitName": null,
              "channelCode": null,
              "orderType": null,
              "id": 1912250009921386,
              "mpId": 1912250009921386,
              "mpName": "直降商品",
              "defaultSupplier": null,
              "firstCategoryId": null,
              "mpCode": "1912250009921383",
              "mpCodeList": null,
              "categoryId": 1909220000112658,
              "categoryName": "安抚玩偶",
              "categoryNodeName": "安抚玩偶",
              "merchantCategoryId": null,
              "merchantCategoryNodeName": null,
              "mpUnit": "件",
              "mpPrice": null,
              "costWithTaxUnitAmt": null,
              "costWithoutTaxUnitAmt": null,
              "mpTax": null,
              "mpPriceWithoutTax": null,
              "mpType": 1,
              "mpTypeText": "普通商品",
              "mpStandard": null,
              "turnoverChannel": null,
              "turnoverChannelText": "",
              "saleTaxRate": 0.11,
              "purchaseTaxRate": 0.10,
              "mpStock": null,
              "brandId": null,
              "brandName": null,
              "barcodeId": null,
              "barcode": null,
              "mpBarcode": null,
              "remark": null,
              "distributionCount": null,
              "currentDelvieryStockCount": null,
              "targetStoreId": null,
              "targetWarehouseId": null,
              "onShelfNum": 0,
              "ongoingNum": 0,
              "inventoryTurnoverDay": 7,
              "isSale": 1,
              "isSaleText": "允许销售",
              "realStockNum": 0,
              "availableStockNum": 0,
              "merchantId": 1909110000098882,
              "merchantIds": null,
              "barcodes": null,
              "mpIds": null,
              "itemIds": null,
              "storeId": null,
              "storeCode": null,
              "storeName": null,
              "storeIds": null,
              "warehouseIds": null,
              "warehouseId": null,
              "warehouseCode": null,
              "warehouseName": null,
              "promotionId": null,
              "promotionName": null,
              "majorPromotionType": null,
              "majorPromotionTypeText": null,
              "promotionType": null,
              "promotionTypeText": null,
              "promotionStartTime": null,
              "promotionEndTime": null,
              "virtualId": null,
              "canSale": null,
              "startItem": 0
            },
            {
              "currentPage": 0,
              "itemsPerPage": 0,
              "dataType": null,
              "chineseName": null,
              "code": null,
              "thirdProductCode": null,
              "brandIds": null,
              "categoryIds": null,
              "parentIds": null,
              "parentId": null,
              "type": null,
              "status": null,
              "productIds": null,
              "productId": null,
              "typeOfProducts": null,
              "typeOfProduct": null,
              "saleType": null,
              "mainUnitName": null,
              "channelCode": null,
              "orderType": null,
              "id": 1912250009656274,
              "mpId": 1912250009656274,
              "mpName": "测试090",
              "defaultSupplier": null,
              "firstCategoryId": null,
              "mpCode": "YTTF99933",
              "mpCodeList": null,
              "categoryId": 1909160000185958,
              "categoryName": "米面粥",
              "categoryNodeName": "米面粥",
              "merchantCategoryId": null,
              "merchantCategoryNodeName": null,
              "mpUnit": "件",
              "mpPrice": null,
              "costWithTaxUnitAmt": null,
              "costWithoutTaxUnitAmt": null,
              "mpTax": null,
              "mpPriceWithoutTax": null,
              "mpType": 3,
              "mpTypeText": "",
              "mpStandard": null,
              "turnoverChannel": null,
              "turnoverChannelText": "",
              "saleTaxRate": null,
              "purchaseTaxRate": null,
              "mpStock": null,
              "brandId": null,
              "brandName": null,
              "barcodeId": null,
              "barcode": "79789",
              "mpBarcode": null,
              "remark": null,
              "distributionCount": null,
              "currentDelvieryStockCount": null,
              "targetStoreId": null,
              "targetWarehouseId": null,
              "onShelfNum": 0,
              "ongoingNum": 0,
              "inventoryTurnoverDay": 7,
              "isSale": 1,
              "isSaleText": "允许销售",
              "realStockNum": 0,
              "availableStockNum": 0,
              "merchantId": 1909110000098882,
              "merchantIds": null,
              "barcodes": null,
              "mpIds": null,
              "itemIds": null,
              "storeId": null,
              "storeCode": null,
              "storeName": null,
              "storeIds": null,
              "warehouseIds": null,
              "warehouseId": null,
              "warehouseCode": null,
              "warehouseName": null,
              "promotionId": null,
              "promotionName": null,
              "majorPromotionType": null,
              "majorPromotionTypeText": null,
              "promotionType": null,
              "promotionTypeText": null,
              "promotionStartTime": null,
              "promotionEndTime": null,
              "virtualId": null,
              "canSale": null,
              "startItem": 0
            },
            {
              "currentPage": 0,
              "itemsPerPage": 0,
              "dataType": null,
              "chineseName": null,
              "code": null,
              "thirdProductCode": null,
              "brandIds": null,
              "categoryIds": null,
              "parentIds": null,
              "parentId": null,
              "type": null,
              "status": null,
              "productIds": null,
              "productId": null,
              "typeOfProducts": null,
              "typeOfProduct": null,
              "saleType": null,
              "mainUnitName": null,
              "channelCode": null,
              "orderType": null,
              "id": 1912250008298790,
              "mpId": 1912250008298790,
              "mpName": "海淘商品",
              "defaultSupplier": null,
              "firstCategoryId": null,
              "mpCode": "YXYHTRX2002012",
              "mpCodeList": null,
              "categoryId": 1909220000112658,
              "categoryName": "安抚玩偶",
              "categoryNodeName": "安抚玩偶",
              "merchantCategoryId": null,
              "merchantCategoryNodeName": null,
              "mpUnit": "升",
              "mpPrice": null,
              "costWithTaxUnitAmt": null,
              "costWithoutTaxUnitAmt": null,
              "mpTax": null,
              "mpPriceWithoutTax": null,
              "mpType": 3,
              "mpTypeText": "",
              "mpStandard": null,
              "turnoverChannel": null,
              "turnoverChannelText": "",
              "saleTaxRate": 0.11,
              "purchaseTaxRate": 0.17,
              "mpStock": null,
              "brandId": null,
              "brandName": null,
              "barcodeId": null,
              "barcode": null,
              "mpBarcode": null,
              "remark": null,
              "distributionCount": null,
              "currentDelvieryStockCount": null,
              "targetStoreId": null,
              "targetWarehouseId": null,
              "onShelfNum": 0,
              "ongoingNum": 0,
              "inventoryTurnoverDay": 7,
              "isSale": 1,
              "isSaleText": "允许销售",
              "realStockNum": 0,
              "availableStockNum": 0,
              "merchantId": 1909110000098882,
              "merchantIds": null,
              "barcodes": null,
              "mpIds": null,
              "itemIds": null,
              "storeId": null,
              "storeCode": null,
              "storeName": null,
              "storeIds": null,
              "warehouseIds": null,
              "warehouseId": null,
              "warehouseCode": null,
              "warehouseName": null,
              "promotionId": null,
              "promotionName": null,
              "majorPromotionType": null,
              "majorPromotionTypeText": null,
              "promotionType": null,
              "promotionTypeText": null,
              "promotionStartTime": null,
              "promotionEndTime": null,
              "virtualId": null,
              "canSale": null,
              "startItem": 0
            }
        ],

        filterColumns: [],
        pageRequest: {pageNum: 1, pageSize: 10},
        pageResult: {},

        editLoading: false,
        active: 1,
        editDialogVisible: false, // 新增编辑界面是否显示
        dataFormProduct :{
          categoryId: "",
          mpName: "",
          mpCode: ""
        }
      };

    },

    methods :{
      queryMerchantList: function () {
        this.editDialogVisible =true;
      },

      // 获取分页数据
      findPage: function (data) {
        this.$refs.CyTable.findPageStaticState(this.filters);
      },

      // 处理表格列过滤显示
      displayFilterColumnsDialog: function () {
        this.$refs.tableColumnFilterDialog.setDialogVisible(true);
      },

      // 处理表格列过滤显示
      handleFilterColumns: function (data) {
        this.filterColumns = data.filterColumns
        this.$refs.tableColumnFilterDialog.setDialogVisible(false)
      },

      // 处理表格列过滤显示
      initColumns: function () {
        let temp = [];

        $.each(this.columns, function (key, val) {
          temp.push(val);
        });
        this.filterColumns = temp;
      },

      preStep: function() {
        var this_ =this;
        this.$router.push({ path:'/paje/ContractTemplate/ContractProductPriceStep1',query:{killid: 1}});
      },

      nextStep: function() {
        var this_ =this;
        this.$router.push({ path:'/paje/ContractTemplate/ContractProductPriceStep3',query:{killid: 1}});
      },

      resetForm(formName) {
        if (this.$refs[formName] != undefined) {
          this.$refs[formName].resetFields();
          this.findPage(null);
        }
      },

      clickProduct: function (index,row){
        let this_ =this;
        console.log(index,row);
      },

      //选择框
      selectionChange: function (params) {
        this.checked = params.selections
      },
      // 批量删除
      handleDelete: function (data) {
        if (data != null && data.params != null && data.params.length > 0) {
          let ids = data.params.map(item => item.id).toString();

          var params = {};
          params.t = "changeProduct";
          params.ids = ids;
          var this_ = this;
          this.utils.request.deleteUserInfo(params, function (res) {
            if (res.code == "0000") {
              this_.$message({message: "操作成功", type: "success"});
              this_.findPage(null);
            } else {
              this_.$message({message: "操作失败, " + res.msg, type: "error"});
            }
          });
        }
      }
    },
    mounted() {
      this.active =1;
      this.initColumns();
    }
  }



</script>

<style scoped>
  /deep/ .form .el-input__inner{
    width: 200px !important;
  }
</style>
